package com.kakarote.hrm.constant;

import lombok.Getter;

@Getter
public enum UnitPropertiesEnum {
    ONE(1, "合并报表企业"),
    TWO(2, "托管企业"),
//    THREE(3, "人员归属");
    OTHER(3, "其他");

    private Integer value;
    private String name;

    UnitPropertiesEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(Integer value) {
        for (UnitPropertiesEnum educationEnum : UnitPropertiesEnum.values()) {
            if (educationEnum.getValue().equals(value)) {
                return educationEnum.getName();
            }
        }
        return "";
    }

    public static Integer getValueByName(String name) {
        for (UnitPropertiesEnum educationEnum : UnitPropertiesEnum.values()) {
            if (educationEnum.getName().equals(name)) {
                return educationEnum.getValue();
            }
        }
        return null;
    }

}
